package com.example.ams.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * 健康检查控制器
 * Health Check Controller
 */
@RestController
public class HealthController {

    @GetMapping("/")
    public Map<String, Object> health() {
        Map<String, Object> result = new HashMap<>();
        result.put("status", "OK");
        result.put("message", "Attendance Management System is running");
        result.put("timestamp", System.currentTimeMillis());
        return result;
    }

    @GetMapping("/api/health")
    public Map<String, Object> apiHealth() {
        Map<String, Object> result = new HashMap<>();
        result.put("status", "OK");
        result.put("message", "API is ready");
        result.put("version", "1.0.0");
        return result;
    }
}

